Fix issue: New Input System - All mouse buttons have the same pointer Id #2071
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes the following bug: https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-90349
When using the IPointerDownHandler (OnPointerDown method) with the New Input System, the eventData.pointerId for any mouse button is always the same, corresponding to the mouse's deviceId.
According to the documentation for Unity 2018:
I mention the 2018 because the documentation on the standalone Unity UI package is lacking the values for the mouse buttons.
Testing status & QA
Tested locally.
Overall Product Risks
Comments to reviewers
Note that
m_CurrentPointerId
is set and checked against the value-1
, which is the same value that should be used for the left mouse button, but in the case of them_CurrentPointerId
it means "none". This is not a problem in the current fix, as it only changes theeventData
object being passed to the event listeners, so them_CurrentPointerId
will still contain the originalpointerId
, which would be the mouse'sdeviceId
.Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: